package com.ccjq.jq173.core.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * describe配置文件读取器
 */
public class DbConfigReader {
    private Properties properties;
    //加载配置文件
    public DbConfigReader(){
        read();
    }
    public void read() {
        properties = new Properties();
        InputStream in = DbConfigReader.class.getResourceAsStream("/dbConfig.properties");
        try {
            properties.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * 根据键获取值
     * @param key 键对象
     * @return  返回值对象
     */
    public String getValue(String key){
        return properties.getProperty(key);
    }

}
